/* 网格预览容器 */
.grid-preview-container {
  width: 100%;
  background: #f8f9fa;
  border-radius: 8px;
  padding: 8px 8px 12px 8px;
  border: 1px solid #e9ecef;
  min-height: 300px;
  max-height: 400px;
  overflow-y: auto;
  overflow-x: visible;
  box-sizing: border-box;
}

.grid-preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  margin-left: 0;
  padding-bottom: 8px;
  border-bottom: 1px solid #dee2e6;
}

.grid-info { font-weight: 600; color: #495057; font-size: 14px; }
.grid-stats { font-size: 12px; color: #6c757d; }

/* 内容网格 */
.content-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin-bottom: 8px;
  margin-left: 0;
  max-height: 280px;
  overflow-y: auto;
  padding: 0 2px;
  justify-items: stretch;
  width: 100%;
  box-sizing: border-box;
}

/* 内容块（卡片） -> 垂直布局：上图标，下标题 */
.content-block {
  background: #fff;
  border: 1px solid #e9ecef;
  border-radius: 6px;
  padding: 16px 6px 10px 6px; /* 预留顶部空间，避免后缀徽标遮挡图标 */
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  min-height: 96px;
  max-height: 96px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  width: 100%;
  box-sizing: border-box;
  min-width: 0;
}

.content-block:hover {
  border-color: #007bff;
  box-shadow: 0 2px 8px rgba(0, 123, 255, 0.12);
  transform: translateY(-2px);
}

/* 图标（与JSX类名对齐） */
.content-icon, .content-block-icon {
  font-size: 30px;
  line-height: 1;
  margin-bottom: 8px;
}

/* 标题（与JSX类名对齐） */
.content-title, .content-block-title {
  font-size: 12px;
  font-weight: 500;
  color: #495057;
  line-height: 1.35;
  word-break: break-word;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2; /* 最多两行，超出省略 */
  -webkit-box-orient: vertical;
}

/* 文件后缀 */
.content-ext {
  position: absolute;
  top: 6px;
  right: 6px;
  font-size: 11px;
  color: #6c757d;
  background: #f1f3f5;
  padding: 2px 8px;
  border-radius: 12px;
  line-height: 1.2;
  max-width: 70%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

/* 预览错误提示（短暂显示） */
.grid-inline-error {
  position: absolute;
  bottom: 8px;
  left: 8px;
  right: 8px;
  background: rgba(255, 245, 245, 0.95);
  color: #b91c1c;
  border: 1px solid #fecaca;
  border-radius: 6px;
  font-size: 11px;
  padding: 6px 8px;
  pointer-events: none;
}

/* 隐藏类型角标（仅保留纯图标+文件名布局） */
.type-tag, .content-block-type { display: none; }

/* 空状态 */
.grid-empty-state { text-align: center; padding: 40px 20px; color: #6c757d; }
.grid-empty-icon { font-size: 48px; margin-bottom: 12px; opacity: 0.5; }
.grid-empty-text { font-size: 14px; margin-bottom: 8px; }
.grid-empty-hint { font-size: 12px; color: #adb5bd; }

/* 加载状态 */
.grid-loading { text-align: center; padding: 40px 20px; color: #6c757d; }
.grid-loading-spinner {
  width: 24px; height: 24px; border: 2px solid #e9ecef; border-top: 2px solid #007bff;
  border-radius: 50%; animation: spin 1s linear infinite; margin: 0 auto 12px;
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* 响应式调整 */
@media (max-width: 576px) {
  .content-grid { grid-template-columns: repeat(4, 1fr); gap: 8px; }
  .content-block { min-height: 90px; max-height: 90px; padding: 8px 4px; }
  .content-icon, .content-block-icon { font-size: 24px; margin-bottom: 6px; }
  .content-title, .content-block-title { font-size: 11px; }
} 